Skip to content

Conversation

ghaithatfeh
Copy link

@ghaithatfeh ghaithatfeh commented Apr 25, 2025

Problem

When deploying, if a directory intended for deletion (like old _next/static/* folders in static Next.js builds) no longer exists, the action throws an unhandled FTP error (550 "No such file or directory") and fails the entire deployment.

This is common in real-world static site workflows where build artifacts change frequently between deployments.

Related to issues #483, #490, #496, #493, #43, and more.


Solution

  • Wrapped removeDir() logic in a try/catch block.
  • If a 550 error (or a "no such file" type error) is encountered, it now logs a warning and safely skips the missing directory instead of throwing.
  • Other unrelated FTP errors are still rethrown normally.

This ensures smoother, more resilient deployments — without risking broken builds — especially when incremental FTP syncing is used.


Benefits

  • No more failed deployments due to missing folders.
  • Makes the action more robust for Next.js static sites, Hugo, Jekyll, and other SSG workflows.
  • Maintains clean error handling: real FTP errors still correctly fail the build.

Notes

  • Tested successfully with GitHub Actions and live FTP deployments.
  • No impact on users who don't have missing directories.
  • Does not change any public APIs or configuration options.

Thank you for maintaining this great action! 🚀
I’d love to contribute more if needed.

@konnng-dev
Copy link

@SamKirkland Could we move forward with merging this PR, or is there something holding it up?

I’m frequently running into errors about missing directories, and this update would really help my workflow.

@konnng-dev
Copy link

konnng-dev commented Aug 26, 2025

Update: I reached Sam and sent a fix for a dependency this action uses and now the issue with removing directories is fixed it seems #513

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants